package org.xm.sk.vo.ob;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.xm.sk.vo.tb.Boder;
import org.xm.sk.vo.tb.Item;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@ApiModel(value = "Boder2User", description = "已预约订单")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Boder2User {

    @ApiModelProperty(value = "订单ID")
    Integer id;

    @ApiModelProperty(value = "预约号")
    String ordernum;

    @ApiModelProperty(value = "需要等待人数")
    Long waitCount;

    @ApiModelProperty(value = "需要等待时间")
    Long waitTime;

    @ApiModelProperty(value = "预约发型师ID")
    Integer hairdresserId;

    @ApiModelProperty(value = "预约发型师")
    String hairdresserName;

    @ApiModelProperty(value = "预约发型师头像图片ID")
    Integer hairdresserImageId;

    @ApiModelProperty(value = "预约门店ID")
    Integer shopId;

    @ApiModelProperty(value = "预约门店名称")
    String shopName;

    @ApiModelProperty(value = "预约项目ID集")
    Set<Integer> itemIds = new HashSet<Integer>(0);

    @ApiModelProperty(value = "预约项目名称集")
    Set<String> itemNames = new HashSet<String>(0);

    @ApiModelProperty(value = "预约电话")
    String phone;

    @ApiModelProperty(value = "预约费用")
    Double priceValue;

    @ApiModelProperty(value = "预约时间")
    Date createdate;
 
    @ApiModelProperty(value = "到店时间")
    Date mkTime;
    
    @ApiModelProperty(value = "实际支付价格")
    Double pay;
    
    @ApiModelProperty(value = "核销码")
    String verificode;
    
    @ApiModelProperty(value = "优惠券码")
    String couponnum;
    
    @ApiModelProperty(value = "优惠金额")
    Double couponValue;

    public Boder2User(Integer id, String ordernum, Long waitCount,
            Long waitTime, Integer hairdresserId, String hairdresserName, Integer hairdresserImageId,
            Integer shopId, String shopName, Boder boder, String itemNs, String phone, Double priceValue,
            Date createdate, Date mkTime, Double pay, String verificode, String couponnum, Double couponValue) {
        this.id = id;
        this.ordernum = ordernum;
        this.waitCount = waitCount;
        this.waitTime = waitTime;
        this.hairdresserId = hairdresserId;
        this.hairdresserName = hairdresserName;
        this.hairdresserImageId = hairdresserImageId;
        this.shopId = shopId;
        this.shopName = shopName;
        for (Item item : boder.getItems()) {
            this.itemIds.add(item.getId());
        }
        if (null != itemNs && 0 < itemNs.length()) {
            String[] items = itemNs.split(",");
            for (String s : items) {
                this.itemNames.add(s);
            }
        }
        this.phone = phone;
        this.priceValue = priceValue;
        this.createdate = createdate;
        this.mkTime = mkTime;
        this.pay = pay;
        this.verificode = verificode;
        this.couponnum = couponnum;
        this.couponValue = couponValue;
    }

}
